<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel=StyleSheet HREF="../stylesheet/stylesheet.css" TYPE="text/css" MEDIA=screen>
<title>Shop Management System</title>
<?php include('menu.php'); ?>
</head>
<body>
<?php
include("../connect/connect.php");

$Query = "SELECT * FROM product,category WHERE product.category_id = category.category_id AND quantity <= rop ORDER BY quantity";
$objQuery = mysql_query($Query) or die ("Error Query [".$Query."]");
?>
<div class="box">
  <div class="left"></div>
  <div class="right"></div>
    <div class="heading">
      <h1>สินค้าที่ต้องสั่งซื้อเพิ่ม</h1></div>
  <div class="content">
  <table class="list">
        <thead>
          <tr>
            <td width="185" style="text-align: center;"><span class="center">รหัสสินค้า</span></td>
            <td width="281" class="center">ชื่อสินค้า</td>
            <td width="304" class="center">หมวดสินค้า</td>
            <td width="234" class="center">จำนวนสินค้าคงเหลือ</td>
          </tr>
        </thead>
        <tbody>
<?php
	while($row = mysql_fetch_array($objQuery))
		{
?>
          <tr>
            <td style="text-align: center;"><?php echo $row["code"];?></td>
            <td class="center"><?php echo $row["name"];?></td>
            <td class="center"><?php echo $row["category_name"];?></td>
            <td class="center"><?php echo $row["quantity"];?></td>
          </tr>
<?php
		}
?>
        </tbody>
      </table>
  </div>
</div>

</body>
</html>
